import { Public } from './../auth/decorators/public.decorator';
import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common';
import { TongBuPositionService } from './tong-bu-position.service';
import { CreateTongBuPositionDto } from './dto/create-tong-bu-position.dto';
import { UpdateTongBuPositionDto } from './dto/update-tong-bu-position.dto';
import { ApiBearerAuth, ApiOperation, ApiQuery, ApiTags } from '@nestjs/swagger';
@ApiBearerAuth()
@ApiTags('同步记录')
@Controller('tongBuPosition')
export class TongBuPositionController {
  constructor(private readonly tongBuPositionService: TongBuPositionService) {}

  // 列表
  @Get('list')
  @ApiOperation({ summary: '查询', description: '查询' })
  @ApiQuery({ name: 'pageNum', type: Number, required: false, description: '页码' })
  @ApiQuery({ name: 'pageSize', type: Number, required: false, description: '每页几条' })
  findAll(@Query() params: any) {
    return this.tongBuPositionService.findAll(params);
  }

  // 删除所有
  @Get('deleteAll')
  @ApiOperation({ summary: '删除所有', description: '删除所有' })
  deleteAll(@Query() params: any) {
    return this.tongBuPositionService.deleteAll();
  }

  // 同步历史仓位记录
  // @Get('tongBuHistoryPositions')
  // @ApiOperation({ summary: '定时同步芝麻的历史仓位', description: '定时同步芝麻的历史仓位' })
  // tongBuHistoryPositions(@Query() params: any) {
  //   return this.tongBuPositionService.tongBuHistoryPositions();
  // }

  @Public()
  @Get('editTongbuTime')
  @ApiOperation({ summary: '批量修改同步时间' })
  editTongbuTime(@Query() params: any) {
    return this.tongBuPositionService.editTongbuTime();
  }

  @Public()
  @Get('deleteErrorData')
  @ApiOperation({ summary: '删除误添加的记录信息' })
  deleteErrorData(@Query() params: any) {
    return this.tongBuPositionService.deleteErrorData();
  }
}
